trigger: none

schedules:
- cron: "0 5 * * *"
  displayName: Mon through Sun at 9:00 PM (UTC-8:00)
  branches:
    include:
    - main
  always: true

variables:
  - template: /eng/pipelines/common/variables.yml

extends:
  template:  /eng/pipelines/common/templates/pipeline-with-resources.yml
  parameters:
    stages:
    - stage: Build
      jobs:

      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/global-build-job.yml
          buildConfig: checked
          platforms:
          - linux_arm64
          - linux_x64
          - windows_arm64
          - windows_x64
          jobParameters:
            buildArgs: -s clr+libs -c $(_BuildConfig) -lc Release
            postBuildSteps:
              - template: /eng/pipelines/coreclr/templates/build-native-test-assets-step.yml
              - template: /eng/pipelines/common/upload-artifact-step.yml
                parameters:
                  rootFolder: $(Build.SourcesDirectory)/artifacts/bin
                  includeRootFolder: false
                  archiveType: $(archiveType)
                  archiveExtension: $(archiveExtension)
                  tarCompression: $(tarCompression)
                  artifactName: BuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)
                  displayName: Build Assets
            extraVariablesTemplates:
              - template: /eng/pipelines/common/templates/runtimes/native-test-assets-variables.yml
                parameters:
                  testGroup: gc-standalone

      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml
          buildConfig: checked
          platforms:
          - CoreClrTestBuildHost # Either osx_x64 or linux_x64
          jobParameters:
            testGroup: gc-standalone

      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
          buildConfig: checked
          platforms:
          - linux_arm64
          - linux_x64
          - windows_arm64
          - windows_x64
          helixQueueGroup: ci
          helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
          jobParameters:
            testGroup: gc-standalone
            displayNameArgs: GCStandAlone
            liveLibrariesBuildConfig: Release
            unifiedArtifactsName: BuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)

      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
          buildConfig: checked
          platforms:
          - linux_arm64
          - linux_x64
          - windows_arm64
          - windows_x64
          helixQueueGroup: ci
          helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
          jobParameters:
            testGroup: gc-standalone-server
            displayNameArgs: GCStandAloneServer
            liveLibrariesBuildConfig: Release
            unifiedArtifactsName: BuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)
